import {
  HTTP
} from '../utils/http.js';

class HomeModel extends HTTP {

  /**
   * 首页数据加载
   * @param {Integer} pageSize 
   */
  home(categoryId, pageNum, pageSize = 20) {
    return this.request({
      url: 'homeIndex',
      data: {
        "token": wx.getStorageSync('token'),
        "pageNum": pageNum,
        "pageSize": pageSize,
        "categoryId": categoryId
      },
      method: 'POST'
    })
  }

  /**
   * 下拉数据 
   */
  pull(category = "1") {
    return this.request({
      url: "homeIndex/pull",
      data: {
        "token": wx.getStorageSync('token'),
        "category": category
      },
      method: 'POST'
    })
  }

}

export {
  HomeModel
}